package com.byxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.byxy.dao.UserDao;
import com.byxy.entity.User;
import com.byxy.service.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService {
	@Autowired
	private UserDao userDao;

	public List<User> findAll() {
		return userDao.findAll();
	}

	public void add(User user) {
		userDao.add(user);
	}

	public User get(Integer userId) {
		return userDao.get(userId);
	}

	public User login(String userName, String userPassword) {
		return userDao.login(userName, userPassword);
	}

	public void update(String userNick, String userPassword, Integer userId) {
		userDao.update(userNick, userPassword, userId);
	}

	public void updateUserStatus(Integer userStatus, Integer userId) {
		userDao.updateUserStatus(userStatus, userId);
	}

}
